package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PostManagerMapper;
import com.ruoyi.system.domain.PostManager;
import com.ruoyi.system.service.IPostManagerService;

/**
 * 主贴Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-08
 */
@Service
public class PostManagerServiceImpl implements IPostManagerService 
{
    @Autowired
    private PostManagerMapper postManagerMapper;

    /**
     * 查询主贴
     * 
     * @param id 主贴主键
     * @return 主贴
     */
    @Override
    public PostManager selectPostManagerById(Long id)
    {
        return postManagerMapper.selectPostManagerById(id);
    }

    /**
     * 查询主贴列表
     * 
     * @param postManager 主贴
     * @return 主贴
     */
    @Override
    public List<PostManager> selectPostManagerList(PostManager postManager)
    {
        return postManagerMapper.selectPostManagerList(postManager);
    }

    /**
     * 新增主贴
     * 
     * @param postManager 主贴
     * @return 结果
     */
    @Override
    public int insertPostManager(PostManager postManager)
    {
        postManager.setCreateTime(DateUtils.getNowDate());
        return postManagerMapper.insertPostManager(postManager);
    }

    /**
     * 修改主贴
     * 
     * @param postManager 主贴
     * @return 结果
     */
    @Override
    public int updatePostManager(PostManager postManager)
    {
        postManager.setUpdateTime(DateUtils.getNowDate());
        return postManagerMapper.updatePostManager(postManager);
    }

    /**
     * 批量删除主贴
     * 
     * @param ids 需要删除的主贴主键
     * @return 结果
     */
    @Override
    public int deletePostManagerByIds(Long[] ids)
    {
        return postManagerMapper.deletePostManagerByIds(ids);
    }

    /**
     * 删除主贴信息
     * 
     * @param id 主贴主键
     * @return 结果
     */
    @Override
    public int deletePostManagerById(Long id)
    {
        return postManagerMapper.deletePostManagerById(id);
    }
}
